/**
 * Copyright ©2016-2020 northkingbpo Corporation, All Rights Reserved
 * http://www.northkingbpo.net/
 */
package profile.hujia.spring.cloud.seata.storage.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import profile.hujia.spring.cloud.seata.storage.service.StorageService;

/**
 * class info
 *
 * @author hujia
 * @date 2019-05-23 10:26
 */
@RestController
public class StorageController {

    private final StorageService storageService;

    public StorageController(StorageService storageService) {
        this.storageService = storageService;
    }

    @GetMapping("/deduct")
    public Boolean deduct(String commodityCode, int count) {
        storageService.deduct(commodityCode, count);
        return true;
    }
}
